#ifndef __STATUS_H__
#define __STATUS_H__

/*****************************************************************************/
/* Constant Definitions */

#define STATUS_GENERAL_ERROR_BASE     -1
#define STATUS_ADC_ERROR_BASE       -100
#define STATUS_CAMERA_ERROR_BASE    -200
#define STATUS_CHUNKMEM_ERROR_BASE  -300
#define STATUS_DISPLAY_ERROR_BASE   -200
#define STATUS_FS_ERROR_BASE        -400
#define STATUS_I2C_ERROR_BASE       -500
#define STATUS_IMAGE_ERROR_BASE     -600
#define STATUS_IO_ERROR_BASE        -700
#define STATUS_KEYPAD_ERROR_BASE    -800
#define STATUS_MIC_ERROR_BASE       -900
#define STATUS_NANDAPP_ERROR_BASE  -1000
#define STATUS_RTC_ERROR_BASE      -1100
#define STATUS_SOCKET_ERROR_BASE   -1200
#define STATUS_SOUND_ERROR_BASE    -1300
#define STATUS_SYSTEM_ERROR_BASE   -1400
#define STATUS_TIMER_ERROR_BASE    -1500
#define STATUS_USBD_ERROR_BASE     -1600
#define STATUS_WIFI_ERROR_BASE     -1700

#define STATUS_OK 0

#define STATUS_BOARD_VERSION_MISMATCH (STATUS_GENERAL_ERROR_BASE)
#define STATUS_INVALID_PARAMETER      (STATUS_GENERAL_ERROR_BASE - 1)
#define STATUS_INITIALIZE_ERROR       (STATUS_GENERAL_ERROR_BASE - 2)
#define STATUS_NOT_INITIALIZED        (STATUS_GENERAL_ERROR_BASE - 3)
#define STATUS_NO_RESOURCE            (STATUS_GENERAL_ERROR_BASE - 4)
#define STATUS_NOT_SUPPORTED          (STATUS_GENERAL_ERROR_BASE - 5)
#define STATUS_SYSTEM_ERROR           (STATUS_GENERAL_ERROR_BASE - 6)

#define STATUS_ADC_READ_ERROR              (STATUS_ADC_ERROR_BASE)
#define STATUS_ADC_TOUCH_CALIBRATION_ERROR (STATUS_ADC_ERROR_BASE - 1)
#define STATUS_ADC_TOUCH_NOT_CALIBRATED    (STATUS_ADC_ERROR_BASE - 2)

#define STATUS_CAMERA_ALREADY_STARTED       (STATUS_CAMERA_ERROR_BASE)
#define STATUS_CAMERA_CAPTURE_ERROR         (STATUS_CAMERA_ERROR_BASE - 1)
#define STATUS_CAMERA_SET_PARAMAMETER_ERROR (STATUS_CAMERA_ERROR_BASE - 2)
#define STATUS_CAMERA_NOT_STARTED           (STATUS_CAMERA_ERROR_BASE - 3)
#define STATUS_CAMERA_SET_RESOLUTION_ERROR  (STATUS_CAMERA_ERROR_BASE - 4)
#define STATUS_CAMERA_START_ERROR           (STATUS_CAMERA_ERROR_BASE - 5)

#define STATUS_CHUNKMEM_ALLOC_ERROR (STATUS_CHUNKMEM_ERROR_BASE)

#define STATUS_DISPLAY_DIMENSION_MISMATCH (STATUS_DISPLAY_ERROR_BASE)
#define STATUS_DISPLAY_FONT_ERROR         (STATUS_DISPLAY_ERROR_BASE - 1)
#define STATUS_DISPLAY_FRAME_BUFFER_ERROR (STATUS_DISPLAY_ERROR_BASE - 2)
#define STATUS_DISPLAY_PWM_ERROR          (STATUS_DISPLAY_ERROR_BASE - 3)

#define STATUS_FS_IO_ERROR   (STATUS_FS_ERROR_BASE)
#define STATUS_FS_OPEN_ERROR (STATUS_FS_ERROR_BASE - 1)
#define STATUS_FS_STAT_ERROR (STATUS_FS_ERROR_BASE - 2)

#define STATUS_I2C_READ_GSENSOR_ERROR                 (STATUS_I2C_ERROR_BASE)
#define STATUS_I2C_SET_GSENSOR_CALIBRATION_DATA_ERROR (STATUS_I2C_ERROR_BASE - 1)

#define STATUS_IMAGE_DECODE_ERROR     (STATUS_IMAGE_ERROR_BASE)
#define STATUS_IMAGE_ENCODE_ERROR     (STATUS_IMAGE_ERROR_BASE - 1)
#define STATUS_IMAGE_LOAD_CODEC_ERROR (STATUS_IMAGE_ERROR_BASE - 2)

#define STATUS_IO_WRITE_ERROR (STATUS_IO_ERROR_BASE)

#define STATUS_KEYPAD_READ_ERROR (STATUS_KEYPAD_ERROR_BASE)

#define STATUS_MIC_GET_RECORD_DATA_ERROR     (STATUS_MIC_ERROR_BASE)
#define STATUS_MIC_RECORDING_ALREADY_STARTED (STATUS_MIC_ERROR_BASE - 1)
#define STATUS_MIC_RECORDING_NOT_STARTED     (STATUS_MIC_ERROR_BASE - 2)
#define STATUS_MIC_START_RECORDING_ERROR     (STATUS_MIC_ERROR_BASE - 3)

#define STATUS_APP_MODE_MISMATCH (STATUS_NANDAPP_ERROR_BASE)
#define STATUS_APP_READ_ERROR    (STATUS_NANDAPP_ERROR_BASE - 1)
#define STATUS_APP_SEEK_ERROR    (STATUS_NANDAPP_ERROR_BASE - 2)
#define STATUS_APP_SET_ID_ERROR  (STATUS_NANDAPP_ERROR_BASE - 3)
#define STATUS_APP_WRITE_ERROR   (STATUS_NANDAPP_ERROR_BASE - 4)

#define STATUS_RTC_READ_ERROR  (STATUS_RTC_ERROR_BASE)
#define STATUS_RTC_WRITE_ERROR (STATUS_RTC_ERROR_BASE - 1)

#define STATUS_SOCKET_ALREADY_OPEN            (STATUS_SOCKET_ERROR_BASE)
#define STATUS_SOCKET_CLIENT_NOT_OPENED       (STATUS_SOCKET_ERROR_BASE - 1)
#define STATUS_SOCKET_DISCONNECTED            (STATUS_SOCKET_ERROR_BASE - 2)
#define STATUS_SOCKET_MAX_CONNECTIONS_REACHED (STATUS_SOCKET_ERROR_BASE - 3)
#define STATUS_SOCKET_NO_CLIENT               (STATUS_SOCKET_ERROR_BASE - 4)
#define STATUS_SOCKET_NO_DATA                 (STATUS_SOCKET_ERROR_BASE - 5)
#define STATUS_SOCKET_NO_CONNECT_REQUEST      (STATUS_SOCKET_ERROR_BASE - 6)
#define STATUS_SOCKET_OPEN_ERROR              (STATUS_SOCKET_ERROR_BASE - 7)
#define STATUS_SOCKET_RECEIVE_ERROR           (STATUS_SOCKET_ERROR_BASE - 8)
#define STATUS_SOCKET_SEND_ERROR              (STATUS_SOCKET_ERROR_BASE - 9)
#define STATUS_SOCKET_SERVER_NOT_OPENED       (STATUS_SOCKET_ERROR_BASE - 10)
#define STATUS_SOCKET_WAIT_CLIENT_ERROR       (STATUS_SOCKET_ERROR_BASE - 11)

#define STATUS_SOUND_NOT_SET    (STATUS_SOUND_ERROR_BASE)
#define STATUS_SOUND_PLAY_ERROR (STATUS_SOUND_ERROR_BASE - 1)
#define STATUS_SOUND_SET_ERROR  (STATUS_SOUND_ERROR_BASE - 2)

#define STATUS_SYSTEM_GET_CPU_CLOCK_ERROR (STATUS_SYSTEM_ERROR_BASE)
#define STATUS_SYSTEM_SET_DSP_CLOCK_ERROR (STATUS_SYSTEM_ERROR_BASE - 1)
#define STATUS_SYSTEM_SET_SD_CLOCK_ERROR  (STATUS_SYSTEM_ERROR_BASE - 2)
#define STATUS_SYSTEM_POWER_OFF_ERROR     (STATUS_SYSTEM_ERROR_BASE - 3)

#define STATUS_TIMER_ALREADY_STARTED (STATUS_TIMER_ERROR_BASE)
#define STATUS_TIMER_NOT_STARTED     (STATUS_TIMER_ERROR_BASE - 1)

#define STATUS_USBD_ALREADY_STARTED (STATUS_USBD_ERROR_BASE)
#define STATUS_USBD_NOT_STARTED     (STATUS_USBD_ERROR_BASE - 1)
#define STATUS_USBD_START_ERROR     (STATUS_USBD_ERROR_BASE - 2)
#define STATUS_USBD_STOP_ERROR      (STATUS_USBD_ERROR_BASE - 3)

#define STATUS_WIFI_ALREADY_STARTED (STATUS_WIFI_ERROR_BASE)
#define STATUS_WIFI_NOT_STARTED     (STATUS_WIFI_ERROR_BASE - 1)
#define STATUS_WIFI_START_ERROR     (STATUS_WIFI_ERROR_BASE - 2)

/*****************************************************************************/
/* End of File */

#endif /*__STATUS_H__*/
